/**
 * @Author YuanYuan
 * @Date 2022/11/22
 * @Time 15:00
 */

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 *
 * @return
 * 请求形如 /message?aa=10&bb=20

 * 在Servlet 代码中获取到 aa 和 bb 的值, 并显示在页面上
*/
@WebServlet("/getQueryString")
public class GetQueryStringServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println(req.getQueryString().toString());
    }
}
